/****************************************************************************/
/*  File:       PkgConfigurer.java                                          */
/*  Author:     F. Georges                                                  */
/*  Company:    H2O Consulting                                              */
/*  Date:       2009-10-19                                                  */
/*  Tags:                                                                   */
/*      Copyright (c) 2009 Florent Georges (see end of file.)               */
/* ------------------------------------------------------------------------ */


package org.expath.pkg.calabash;

import com.xmlcalabash.core.XProcRuntime;
import com.xmlcalabash.util.CalabashConfigurer;
import com.xmlcalabash.util.JaxpConfigurer;
import com.xmlcalabash.util.JingConfigurer;
import com.xmlcalabash.util.SaxonConfigurer;
import com.xmlcalabash.util.XProcConfigurer;
import org.expath.pkg.repo.Repository;

/**
 * Calabash configurer factory for the EXPath Packaging System.
 *
 * @author Florent Georges
 * @date   2009-10-19
 */
public class PkgConfigurer
        implements XProcConfigurer
{
    public PkgConfigurer(XProcRuntime runtime, Repository repo)
    {
        myRuntime = runtime;
        myRepo    = repo;
    }

    @Override
    public CalabashConfigurer getCalabashConfigurer()
    {
        if ( myCalabash == null ) {
            myCalabash = new PkgCalabashConfigurer(myRuntime, myRepo);
        }
        return myCalabash;
    }

    @Override
    public JaxpConfigurer getJaxpConfigurer()
    {
        if ( myJaxp == null ) {
            myJaxp = new PkgJaxpConfigurer(myRepo);
        }
        return myJaxp;
    }

    @Override
    public JingConfigurer getJingConfigurer()
    {
        if ( myJing == null ) {
            myJing = new PkgJingConfigurer(myRepo);
        }
        return myJing;
    }

    @Override
    public SaxonConfigurer getSaxonConfigurer()
    {
        if ( mySaxon == null ) {
            mySaxon = new PkgSaxonConfigurer(myRepo);
        }
        return mySaxon;
    }

    private XProcRuntime       myRuntime;
    private Repository         myRepo;
    private CalabashConfigurer myCalabash = null;
    private JaxpConfigurer     myJaxp     = null;
    private JingConfigurer     myJing     = null;
    private SaxonConfigurer    mySaxon    = null;
}


/* ------------------------------------------------------------------------ */
/*  DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS COMMENT.               */
/*                                                                          */
/*  The contents of this file are subject to the Mozilla Public License     */
/*  Version 1.0 (the "License"); you may not use this file except in        */
/*  compliance with the License. You may obtain a copy of the License at    */
/*  http://www.mozilla.org/MPL/.                                            */
/*                                                                          */
/*  Software distributed under the License is distributed on an "AS IS"     */
/*  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.  See    */
/*  the License for the specific language governing rights and limitations  */
/*  under the License.                                                      */
/*                                                                          */
/*  The Original Code is: all this file.                                    */
/*                                                                          */
/*  The Initial Developer of the Original Code is Florent Georges.          */
/*                                                                          */
/*  Contributor(s): none.                                                   */
/* ------------------------------------------------------------------------ */
